var app = getApp();

Page({
    data: {
        none_list: !1,
        page: 1,
        goods_list: []
    },
    onLoad: function(t) {
        wx.setNavigationBarColor({
          frontColor: '#000000',
          backgroundColor: '#ffffff'
        });
        this.setData({
            type_id: t.id,
            url: wx.getStorageSync("url")
        }), this.reload();
    },
    reload: function(t) {
        var o = this, a = o.data.page, n = o.data.type_id, e = o.data.goods_list;
        app.util.request({
            url: "entry/wxapp/JfGoodsList",
            cachetime: "0",
            data: {
                page: a,
                type_id: n
            },
            success: function(t) {
                console.log(t), 0 < t.data.length ? (o.setData({
                    page: a + 1
                }), e = e.concat(t.data), o.setData({
                    goods_list: e
                })) : o.setData({
                    none_list: !0
                });
            }
        });
    },
    jifeninfo: function(t) {
        wx.navigateTo({
            url: "jifeninfo?id=" + t.currentTarget.dataset.id
        });
    },
    onReady: function() {},
    onShow: function() {},
    onHide: function() {},
    onUnload: function() {},
    onPullDownRefresh: function() {
        this.setData({
            page: 1,
            goods_list: []
        }), this.reload(), wx.stopPullDownRefresh();
    },
    onReachBottom: function() {
        this.reload();
    }
});